<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Navo Portable Library: navo/algorithm/crypto/symmetric/cast6.c源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Navo Portable Library&#160;<span id="projectnumber">Ver 1.0.20120827</span></div>
   <div id="projectbrief">Provides generic platform independent facilities.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>数据结构</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>全局定义</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>navo/algorithm/crypto/symmetric/cast6.c</h1>  </div>
</div>
<div class="contents">
<a href="cast6_8c.html">浏览该文件的文档。</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */</span>
<a name="l00011"></a>00011 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#pragma optimize(&quot;t&quot;, on)</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#endif  </span><span class="comment">/* #ifdef _MSC_VER */</span>
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;<a class="code" href="cast6_8h.html" title="Cast6.">cast6.h</a>&quot;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="endian_8h.html" title="Definitions for byte order.">../../../port/endian.h</a>&quot;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include &lt;cstring&gt;</span>
<a name="l00020"></a>00020 <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00021"></a>00021 <span class="preprocessor">#else</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#endif </span><span class="comment">/* #ifdef __cplusplus */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="keyword">static</span> <span class="keyword">const</span> uint32_t TM[24][8] = {
<a name="l00026"></a>00026  {  0x5a827999UL, 0xc95c653aUL, 0x383650dbUL, 0xa7103c7cUL,
<a name="l00027"></a>00027     0x15ea281dUL, 0x84c413beUL, 0xf39dff5fUL, 0x6277eb00UL },
<a name="l00028"></a>00028  {  0xd151d6a1UL, 0x402bc242UL, 0xaf05ade3UL, 0x1ddf9984UL, 
<a name="l00029"></a>00029     0x8cb98525UL, 0xfb9370c6UL, 0x6a6d5c67UL, 0xd9474808UL },
<a name="l00030"></a>00030  {  0x482133a9UL, 0xb6fb1f4aUL, 0x25d50aebUL, 0x94aef68cUL, 
<a name="l00031"></a>00031     0x0388e22dUL, 0x7262cdceUL, 0xe13cb96fUL, 0x5016a510UL },
<a name="l00032"></a>00032  {  0xbef090b1UL, 0x2dca7c52UL, 0x9ca467f3UL, 0x0b7e5394UL, 
<a name="l00033"></a>00033     0x7a583f35UL, 0xe9322ad6UL, 0x580c1677UL, 0xc6e60218UL },
<a name="l00034"></a>00034  {  0x35bfedb9UL, 0xa499d95aUL, 0x1373c4fbUL, 0x824db09cUL, 
<a name="l00035"></a>00035     0xf1279c3dUL, 0x600187deUL, 0xcedb737fUL, 0x3db55f20UL },
<a name="l00036"></a>00036  {  0xac8f4ac1UL, 0x1b693662UL, 0x8a432203UL, 0xf91d0da4UL, 
<a name="l00037"></a>00037     0x67f6f945UL, 0xd6d0e4e6UL, 0x45aad087UL, 0xb484bc28UL },
<a name="l00038"></a>00038  {  0x235ea7c9UL, 0x9238936aUL, 0x01127f0bUL, 0x6fec6aacUL, 
<a name="l00039"></a>00039     0xdec6564dUL, 0x4da041eeUL, 0xbc7a2d8fUL, 0x2b541930UL },
<a name="l00040"></a>00040  {  0x9a2e04d1UL, 0x0907f072UL, 0x77e1dc13UL, 0xe6bbc7b4UL, 
<a name="l00041"></a>00041     0x5595b355UL, 0xc46f9ef6UL, 0x33498a97UL, 0xa2237638UL },
<a name="l00042"></a>00042  {  0x10fd61d9UL, 0x7fd74d7aUL, 0xeeb1391bUL, 0x5d8b24bcUL, 
<a name="l00043"></a>00043     0xcc65105dUL, 0x3b3efbfeUL, 0xaa18e79fUL, 0x18f2d340UL },
<a name="l00044"></a>00044  {  0x87ccbee1UL, 0xf6a6aa82UL, 0x65809623UL, 0xd45a81c4UL, 
<a name="l00045"></a>00045     0x43346d65UL, 0xb20e5906UL, 0x20e844a7UL, 0x8fc23048UL },
<a name="l00046"></a>00046  {  0xfe9c1be9UL, 0x6d76078aUL, 0xdc4ff32bUL, 0x4b29deccUL, 
<a name="l00047"></a>00047     0xba03ca6dUL, 0x28ddb60eUL, 0x97b7a1afUL, 0x06918d50UL },
<a name="l00048"></a>00048  {  0x756b78f1UL, 0xe4456492UL, 0x531f5033UL, 0xc1f93bd4UL, 
<a name="l00049"></a>00049     0x30d32775UL, 0x9fad1316UL, 0x0e86feb7UL, 0x7d60ea58UL },
<a name="l00050"></a>00050  {  0xec3ad5f9UL, 0x5b14c19aUL, 0xc9eead3bUL, 0x38c898dcUL, 
<a name="l00051"></a>00051     0xa7a2847dUL, 0x167c701eUL, 0x85565bbfUL, 0xf4304760UL },
<a name="l00052"></a>00052  {  0x630a3301UL, 0xd1e41ea2UL, 0x40be0a43UL, 0xaf97f5e4UL, 
<a name="l00053"></a>00053     0x1e71e185UL, 0x8d4bcd26UL, 0xfc25b8c7UL, 0x6affa468UL },
<a name="l00054"></a>00054  {  0xd9d99009UL, 0x48b37baaUL, 0xb78d674bUL, 0x266752ecUL, 
<a name="l00055"></a>00055     0x95413e8dUL, 0x041b2a2eUL, 0x72f515cfUL, 0xe1cf0170UL },
<a name="l00056"></a>00056  {  0x50a8ed11UL, 0xbf82d8b2UL, 0x2e5cc453UL, 0x9d36aff4UL, 
<a name="l00057"></a>00057     0x0c109b95UL, 0x7aea8736UL, 0xe9c472d7UL, 0x589e5e78UL },
<a name="l00058"></a>00058  {  0xc7784a19UL, 0x365235baUL, 0xa52c215bUL, 0x14060cfcUL, 
<a name="l00059"></a>00059     0x82dff89dUL, 0xf1b9e43eUL, 0x6093cfdfUL, 0xcf6dbb80UL },
<a name="l00060"></a>00060  {  0x3e47a721UL, 0xad2192c2UL, 0x1bfb7e63UL, 0x8ad56a04UL, 
<a name="l00061"></a>00061     0xf9af55a5UL, 0x68894146UL, 0xd7632ce7UL, 0x463d1888UL },
<a name="l00062"></a>00062  {  0xb5170429UL, 0x23f0efcaUL, 0x92cadb6bUL, 0x01a4c70cUL, 
<a name="l00063"></a>00063     0x707eb2adUL, 0xdf589e4eUL, 0x4e3289efUL, 0xbd0c7590UL },
<a name="l00064"></a>00064  {  0x2be66131UL, 0x9ac04cd2UL, 0x099a3873UL, 0x78742414UL, 
<a name="l00065"></a>00065     0xe74e0fb5UL, 0x5627fb56UL, 0xc501e6f7UL, 0x33dbd298UL },
<a name="l00066"></a>00066  {  0xa2b5be39UL, 0x118fa9daUL, 0x8069957bUL, 0xef43811cUL, 
<a name="l00067"></a>00067     0x5e1d6cbdUL, 0xccf7585eUL, 0x3bd143ffUL, 0xaaab2fa0UL },
<a name="l00068"></a>00068  {  0x19851b41UL, 0x885f06e2UL, 0xf738f283UL, 0x6612de24UL, 
<a name="l00069"></a>00069     0xd4ecc9c5UL, 0x43c6b566UL, 0xb2a0a107UL, 0x217a8ca8UL },
<a name="l00070"></a>00070  {  0x90547849UL, 0xff2e63eaUL, 0x6e084f8bUL, 0xdce23b2cUL, 
<a name="l00071"></a>00071     0x4bbc26cdUL, 0xba96126eUL, 0x296ffe0fUL, 0x9849e9b0UL },
<a name="l00072"></a>00072  {  0x0723d551UL, 0x75fdc0f2UL, 0xe4d7ac93UL, 0x53b19834UL, 
<a name="l00073"></a>00073     0xc28b83d5UL, 0x31656f76UL, 0xa03f5b17UL, 0x0f1946b8UL }
<a name="l00074"></a>00074  };
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a> TR[4][8] = {
<a name="l00077"></a>00077  { 0x13, 0x04, 0x15, 0x06, 0x17, 0x08, 0x19, 0x0a },
<a name="l00078"></a>00078  { 0x1b, 0x0c, 0x1d, 0x0e, 0x1f, 0x10, 0x01, 0x12 },
<a name="l00079"></a>00079  { 0x03, 0x14, 0x05, 0x16, 0x07, 0x18, 0x09, 0x1a },
<a name="l00080"></a>00080  { 0x0b, 0x1c, 0x0d, 0x1e, 0x0f, 0x00, 0x11, 0x02 }
<a name="l00081"></a>00081 };
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s1[256];
<a name="l00084"></a>00084 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s2[256];
<a name="l00085"></a>00085 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s3[256];
<a name="l00086"></a>00086 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s4[256];
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="preprocessor">#define S1 __cast_s1</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define S2 __cast_s2</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define S3 __cast_s3</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define S4 __cast_s4</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span>
<a name="l00093"></a>00093 <span class="preprocessor">#define FN(i, r) ((i) = __rol32((i), (r)), \</span>
<a name="l00094"></a>00094 <span class="preprocessor">    ((S1[(i) &gt;&gt; 24] ^ S2[((i) &gt;&gt; 16) &amp; 0xFF]) - \</span>
<a name="l00095"></a>00095 <span class="preprocessor">    S3[((i) &gt;&gt; 8) &amp; 0xFF] + S4[(i) &amp; 0xFF]))</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span>
<a name="l00097"></a>00097 <span class="preprocessor">#define F1(i, d, m, r) ((i) = ((m) + (d)), FN(i, r))</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#define F2(i, d, m, r) ((i) = ((m) ^ (d)), FN(i, r))</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define F3(i, d, m, r) ((i) = ((m) - (d)), FN(i, r))</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>
<a name="l00101"></a>00101 <span class="preprocessor">#define ROUND1(i, l, r, t, c) \</span>
<a name="l00102"></a>00102 <span class="preprocessor">    (t) = (l); (l) = (r); (r) = (t) ^ F1(i, r, km[c], kr[c])</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#define ROUND2(i, l, r, t, c) \</span>
<a name="l00104"></a>00104 <span class="preprocessor">    (t) = (l); (l) = (r); (r) = (t) ^ F2(i, r, km[c], kr[c])</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#define ROUND3(i, l, r, t, c) \</span>
<a name="l00106"></a>00106 <span class="preprocessor">    (t) = (l); (l) = (r); (r) = (t) ^ F3(i, r, km[c], kr[c])</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span>
<a name="l00108"></a>00108 <span class="preprocessor">#define XI(i) ((x[(i) &gt;&gt; 2] &gt;&gt; ((3 - ((i) &amp; 3)) &lt;&lt; 3)) &amp; 0xFF)</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="preprocessor">#define ZI(i) ((z[(i) &gt;&gt; 2] &gt;&gt; ((3 - ((i) &amp; 3)) &lt;&lt; 3)) &amp; 0xFF)</span>
<a name="l00110"></a>00110 <span class="preprocessor"></span>
<a name="l00111"></a>00111 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> W(uint32_t* key, <span class="keywordtype">size_t</span> i)
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113     uint32_t I;
<a name="l00114"></a>00114 
<a name="l00115"></a>00115     key[6] ^= F1(I, key[7], TR[i &amp; 3][0], TM[i][0]);
<a name="l00116"></a>00116     key[5] ^= F2(I, key[6], TR[i &amp; 3][1], TM[i][1]);
<a name="l00117"></a>00117     key[4] ^= F3(I, key[5], TR[i &amp; 3][2], TM[i][2]);
<a name="l00118"></a>00118     key[3] ^= F1(I, key[4], TR[i &amp; 3][3], TM[i][3]);
<a name="l00119"></a>00119     key[2] ^= F2(I, key[3], TR[i &amp; 3][4], TM[i][4]);
<a name="l00120"></a>00120     key[1] ^= F3(I, key[2], TR[i &amp; 3][5], TM[i][5]);
<a name="l00121"></a>00121     key[0] ^= F1(I, key[1], TR[i &amp; 3][6], TM[i][6]);
<a name="l00122"></a>00122     key[7] ^= F2(I, key[0], TR[i &amp; 3][7], TM[i][7]);
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 
<a name="l00125"></a>00125 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> Q(uint32_t* blk, uint32_t* km, <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* kr)
<a name="l00126"></a>00126 {
<a name="l00127"></a>00127     uint32_t I;
<a name="l00128"></a>00128 
<a name="l00129"></a>00129     blk[2] ^= F1(I, blk[3], km[0], kr[0]);
<a name="l00130"></a>00130     blk[1] ^= F2(I, blk[2], km[1], kr[1]);
<a name="l00131"></a>00131     blk[0] ^= F3(I, blk[1], km[2], kr[2]);
<a name="l00132"></a>00132     blk[3] ^= F1(I, blk[0], km[3], kr[3]);
<a name="l00133"></a>00133 }
<a name="l00134"></a>00134 
<a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> QBAR(uint32_t* blk, uint32_t* km, <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* kr)
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137     uint32_t I;
<a name="l00138"></a>00138 
<a name="l00139"></a>00139     blk[3] ^= F1(I, blk[0], km[3], kr[3]);
<a name="l00140"></a>00140     blk[0] ^= F3(I, blk[1], km[2], kr[2]);
<a name="l00141"></a>00141     blk[1] ^= F2(I, blk[2], km[1], kr[1]);
<a name="l00142"></a>00142     blk[2] ^= F1(I, blk[3], km[0], kr[0]);
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 NV_IMPL <span class="keywordtype">int</span> __cast6_set_key(uint32_t (*km)[4], <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a> (*kr)[4],
<a name="l00146"></a>00146                                 <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* src_key, <span class="keywordtype">size_t</span> cnt)
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148     uint32_t k[8];
<a name="l00149"></a>00149     uint32_t _k[8] = {0, 0, 0, 0, 0, 0, 0, 0};
<a name="l00150"></a>00150     <span class="keywordtype">int</span> i;
<a name="l00151"></a>00151 
<a name="l00152"></a>00152     <span class="keywordflow">if</span> (cnt &amp; 3)
<a name="l00153"></a>00153         <span class="keywordflow">return</span> 0;
<a name="l00154"></a>00154 
<a name="l00155"></a>00155     memcpy(_k, src_key, cnt);
<a name="l00156"></a>00156 
<a name="l00157"></a>00157     k[0] = __be32_to_cpu(_k[0]);
<a name="l00158"></a>00158     k[1] = __be32_to_cpu(_k[1]);
<a name="l00159"></a>00159     k[2] = __be32_to_cpu(_k[2]);
<a name="l00160"></a>00160     k[3] = __be32_to_cpu(_k[3]);
<a name="l00161"></a>00161     k[4] = __be32_to_cpu(_k[4]);
<a name="l00162"></a>00162     k[5] = __be32_to_cpu(_k[5]);
<a name="l00163"></a>00163     k[6] = __be32_to_cpu(_k[6]);
<a name="l00164"></a>00164     k[7] = __be32_to_cpu(_k[7]);
<a name="l00165"></a>00165 
<a name="l00166"></a>00166     <span class="keywordflow">for</span> (i = 0; i &lt; 12; ++i) {
<a name="l00167"></a>00167         W(k, (i &lt;&lt; 1));
<a name="l00168"></a>00168         W(k, (i &lt;&lt; 1) + 1);
<a name="l00169"></a>00169 
<a name="l00170"></a>00170         kr[i][0] = k[0] &amp; 0x1F;
<a name="l00171"></a>00171         kr[i][1] = k[2] &amp; 0x1F;
<a name="l00172"></a>00172         kr[i][2] = k[4] &amp; 0x1F;
<a name="l00173"></a>00173         kr[i][3] = k[6] &amp; 0x1F;
<a name="l00174"></a>00174 
<a name="l00175"></a>00175         kr[i][0] = k[7];
<a name="l00176"></a>00176         kr[i][1] = k[5];
<a name="l00177"></a>00177         kr[i][2] = k[3];
<a name="l00178"></a>00178         kr[i][3] = k[1];
<a name="l00179"></a>00179     }
<a name="l00180"></a>00180 
<a name="l00181"></a>00181     <span class="keywordflow">return</span> 1;
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 NV_IMPL <span class="keywordtype">void</span> __cast6_encrypt(uint32_t (*km)[4], <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a> (*kr)[4],
<a name="l00185"></a>00185                             uint32_t* dst, uint32_t* src)
<a name="l00186"></a>00186 {
<a name="l00187"></a>00187     uint32_t blk[4];
<a name="l00188"></a>00188     uint32_t* pm;
<a name="l00189"></a>00189     <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* pr;
<a name="l00190"></a>00190 
<a name="l00191"></a>00191     blk[0] = __be32_to_cpu(src[0]);
<a name="l00192"></a>00192     blk[1] = __be32_to_cpu(src[1]);
<a name="l00193"></a>00193     blk[2] = __be32_to_cpu(src[2]);
<a name="l00194"></a>00194     blk[3] = __be32_to_cpu(src[3]);
<a name="l00195"></a>00195 
<a name="l00196"></a>00196     pm = km[0]; pr = kr[0]; Q(blk, pm, pr);
<a name="l00197"></a>00197     pm = km[1]; pr = kr[1]; Q(blk, pm, pr);
<a name="l00198"></a>00198     pm = km[2]; pr = kr[2]; Q(blk, pm, pr);
<a name="l00199"></a>00199     pm = km[3]; pr = kr[3]; Q(blk, pm, pr);
<a name="l00200"></a>00200     pm = km[4]; pr = kr[4]; Q(blk, pm, pr);
<a name="l00201"></a>00201     pm = km[5]; pr = kr[5]; Q(blk, pm, pr);
<a name="l00202"></a>00202 
<a name="l00203"></a>00203     pm = km[ 6]; pr = kr[ 6]; QBAR(blk, pm, pr);
<a name="l00204"></a>00204     pm = km[ 7]; pr = kr[ 7]; QBAR(blk, pm, pr);
<a name="l00205"></a>00205     pm = km[ 8]; pr = kr[ 8]; QBAR(blk, pm, pr);
<a name="l00206"></a>00206     pm = km[ 9]; pr = kr[ 9]; QBAR(blk, pm, pr);
<a name="l00207"></a>00207     pm = km[10]; pr = kr[10]; QBAR(blk, pm, pr);
<a name="l00208"></a>00208     pm = km[11]; pr = kr[11]; QBAR(blk, pm, pr);
<a name="l00209"></a>00209 
<a name="l00210"></a>00210     dst[0] = __cpu_to_be32(blk[0]);
<a name="l00211"></a>00211     dst[1] = __cpu_to_be32(blk[1]);
<a name="l00212"></a>00212     dst[2] = __cpu_to_be32(blk[2]);
<a name="l00213"></a>00213     dst[3] = __cpu_to_be32(blk[3]);
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215 
<a name="l00216"></a>00216 NV_IMPL <span class="keywordtype">void</span> __cast6_decrypt(uint32_t (*km)[4], <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a> (*kr)[4],
<a name="l00217"></a>00217                             uint32_t* dst, uint32_t* src)
<a name="l00218"></a>00218 {
<a name="l00219"></a>00219     uint32_t blk[4];
<a name="l00220"></a>00220     uint32_t* pm;
<a name="l00221"></a>00221     <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* pr;
<a name="l00222"></a>00222 
<a name="l00223"></a>00223     blk[0] = __be32_to_cpu(src[0]);
<a name="l00224"></a>00224     blk[1] = __be32_to_cpu(src[1]);
<a name="l00225"></a>00225     blk[2] = __be32_to_cpu(src[2]);
<a name="l00226"></a>00226     blk[3] = __be32_to_cpu(src[3]);
<a name="l00227"></a>00227 
<a name="l00228"></a>00228     pm = km[11]; pr = kr[11]; Q(blk, pm, pr);
<a name="l00229"></a>00229     pm = km[10]; pr = kr[10]; Q(blk, pm, pr);
<a name="l00230"></a>00230     pm = km[ 9]; pr = kr[ 9]; Q(blk, pm, pr);
<a name="l00231"></a>00231     pm = km[ 8]; pr = kr[ 8]; Q(blk, pm, pr);
<a name="l00232"></a>00232     pm = km[ 7]; pr = kr[ 7]; Q(blk, pm, pr);
<a name="l00233"></a>00233     pm = km[ 6]; pr = kr[ 6]; Q(blk, pm, pr);
<a name="l00234"></a>00234 
<a name="l00235"></a>00235     pm = km[5]; pr = kr[5]; QBAR(blk, pm, pr);
<a name="l00236"></a>00236     pm = km[4]; pr = kr[4]; QBAR(blk, pm, pr);
<a name="l00237"></a>00237     pm = km[3]; pr = kr[3]; QBAR(blk, pm, pr);
<a name="l00238"></a>00238     pm = km[2]; pr = kr[2]; QBAR(blk, pm, pr);
<a name="l00239"></a>00239     pm = km[1]; pr = kr[1]; QBAR(blk, pm, pr);
<a name="l00240"></a>00240     pm = km[0]; pr = kr[0]; QBAR(blk, pm, pr);
<a name="l00241"></a>00241 
<a name="l00242"></a>00242     dst[0] = __cpu_to_be32(blk[0]);
<a name="l00243"></a>00243     dst[1] = __cpu_to_be32(blk[1]);
<a name="l00244"></a>00244     dst[2] = __cpu_to_be32(blk[2]);
<a name="l00245"></a>00245     dst[3] = __cpu_to_be32(blk[3]);
<a name="l00246"></a>00246 }
<a name="l00247"></a>00247 
<a name="l00248"></a>00248 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00249"></a>00249 <span class="preprocessor"></span>}
<a name="l00250"></a>00250 <span class="preprocessor">#endif </span><span class="comment">/* #ifdef __cplusplus */</span>
<a name="l00251"></a>00251 
</pre></div></div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>数据结构</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2015年七月16日 星期四 12:00:37 for Navo Portable Library by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>
